<?php

namespace Application\Model\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Skill
 *
 * @ORM\Table(name="skill", indexes={@ORM\Index(name="fk_Skills_CategorySkills1_idx", columns={"CategorySkills_Id"})})
 * @ORM\Entity
 */
class Skill
{
    /**
     * @var integer
     *
     * @ORM\Column(name="Id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="Skill", type="string", length=45, nullable=true)
     */
    private $skill;

    /**
     * @var \Application\Model\Entity\Categoryskill
     *
     * @ORM\ManyToOne(targetEntity="Application\Model\Entity\Categoryskill")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="CategorySkills_Id", referencedColumnName="Id")
     * })
     */
    private $categoryskills;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Application\Model\Entity\User", inversedBy="skills")
     * @ORM\JoinTable(name="userskill",
     *   joinColumns={
     *     @ORM\JoinColumn(name="Skills_Id", referencedColumnName="Id")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="Users_Id", referencedColumnName="Id")
     *   }
     * )
     */
    private $users;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->users = new \Doctrine\Common\Collections\ArrayCollection();
    }


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set skill
     *
     * @param string $skill
     * @return Skill
     */
    public function setSkill($skill)
    {
        $this->skill = $skill;

        return $this;
    }

    /**
     * Get skill
     *
     * @return string 
     */
    public function getSkill()
    {
        return $this->skill;
    }

    /**
     * Set categoryskills
     *
     * @param \Application\Model\Entity\Categoryskill $categoryskills
     * @return Skill
     */
    public function setCategoryskills(\Application\Model\Entity\Categoryskill $categoryskills = null)
    {
        $this->categoryskills = $categoryskills;

        return $this;
    }

    /**
     * Get categoryskills
     *
     * @return \Application\Model\Entity\Categoryskill 
     */
    public function getCategoryskills()
    {
        return $this->categoryskills;
    }

    /**
     * Add users
     *
     * @param \Application\Model\Entity\User $users
     * @return Skill
     */
    public function addUser(\Application\Model\Entity\User $users)
    {
        $this->users[] = $users;

        return $this;
    }

    /**
     * Remove users
     *
     * @param \Application\Model\Entity\User $users
     */
    public function removeUser(\Application\Model\Entity\User $users)
    {
        $this->users->removeElement($users);
    }

    /**
     * Get users
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsers()
    {
        return $this->users;
    }
}
